import request from '@/utils/request';

// 应付单列表
export function List(query) {
	return request({
		url: '/finance/financeProceeds/list',
		method: 'get',
		params: query,
	});
}

export function BatchProceeds(data) {
	return request({
		url: '/finance/financeProceeds/BatchProceeds',
		method: 'put',
		data,
	});
}

export const ExportFile = 'finance/financeProceeds/export';

export const ImportStencilBatchProceeds =
	'/finance/financeProceeds/importStencilBatchProceeds';

// 跳主订单
export function OrderParam(orderCode) {
	return request({
		url: `/order/order/orderParam/${orderCode}`,
		method: 'get',
	});
}
// 跳子订单
export function OrderCar(orderCarId) {
	return request({
		url: `/order/orderCar/info/${orderCarId}`,
		method: 'get',
	});
}
// 跳外部转租
export function outChangeRentParam(params) {
	return request({
		url: '/external/outChangeRent/queryByCode',
		method: 'get',
		params,
	});
}
export function OrderParamOrderCarCode(orderCarCode) {
	return request({
		url: `/order/orderCar/orderCarParam/${orderCarCode}`,
		method: 'get',
	});
}

// 导入应收账款模版批量核销收款
export function importStencilBatchProceeds(data) {
	return request({
		url: '/finance/financeProceeds/importStencilBatchProceeds',
		method: 'post',
		data: data,
	});
}

// 一键核销
export function chargeOff(data) {
	return request({
		url: '/finance/financeProceeds/chargeOff',
		method: 'post',
		data: data,
	});
}

export function getReceivableList(params) {
	return request({
		url: `/finance/financeProceeds/chargeOffPage`,
		method: 'get',
		params,
	});
}

// 一键小模块核销
export function chargeOffSmall(data) {
	return request({
		url: '/finance/financeProceeds/chargeOffItem',
		method: 'post',
		data: data,
	});
}
